package indi.kider.server.appclient.service.related;

import indi.kider.common.model.apabus.Bus;
import indi.kider.common.model.apabus.Dispatch;
import indi.kider.common.model.apabus.Evaluate;
import indi.kider.common.model.apabus.ServiceDelivery;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import pers.vankid.common.model.base.CommonResponse;
import pers.vankid.common.utils.page.PageRequest;
import pers.vankid.common.utils.page.PageResponse;

@FeignClient(value = "apabus")
public interface ApaBusService {

    //{"", 1,"保洁", 2,"搬家", 3,"维修" 4,"投诉建议"}
    @PostMapping("apartbus/serviceDelivery")
    CommonResponse serviceDelivery(@RequestBody ServiceDelivery serviceDelivery);

    @PostMapping("apartbus/list")
    CommonResponse<PageResponse> getPageServiceList(@RequestBody PageRequest<Bus> request);

    /**
     * @api {PUT} /workOrderReceipt
     * @apiGroup apartbus
     * @apiDescription 服务派单回执
     * @apiParamExample 请求样例：
     * http://localhost:9002/apabus/apabus/workOrderReceipt
     * {"busId":1,"result":"完美解决"}
     * @apiSuccessExample {json} 返回样例:
     * {
     * "status": "201",
     * "msg": "保存成功！",
     * "data": 1
     * }
     */
    @PutMapping("apartbus/workOrderReceipt")
    CommonResponse workOrderReceipt(@RequestBody Dispatch dispatch);

    @PutMapping("apartbus/evaluate")
    CommonResponse evaluate(@RequestBody Evaluate evaluate);

    @PutMapping("apartbus/service")
    CommonResponse delBus(@RequestBody Bus bus);
}
